Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

array and hashes in ruby

Ruby array is a list of elements that can be of any type either string or integer. Hence, In ruby it can be integer or string.  we can declare array by placing the elements inside the brackets like;- arr = [1,"array",2,3,"h...

How to create Ruby hash in just one line ?

When we have to create a hash in just one line we can use this particular ruby code: @users = User.find :all user_hash = Hash[@users.map {|x| [x.id, x.name]}] Here we created a hash in just one line with Id as the key of hash a...
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: